A module system permits the definition of a set of modules. Each module in a module system corresponds to a respective collection of code. A module system specifies how a collection of code corresponding to a particular module can access code corresponding to other modules. A module descriptor (interchangeably referred to as a “module interface”), for a particular module, expresses other modules upon which the particular module may depend. The declaration of a dependency on another module may be referred to as an explicit dependency. A module descriptor also expresses the elements of a particular module that are exposed by the particular module to the other modules which declare an explicit dependency on the particular module. Other modules which do not declare an explicit dependency on the particular module are restricted from accessing such elements.
Conventionally, module systems are designed to allow certain access techniques and/or accessibility configurations to override access restrictions declared in a module descriptor. In one example, reflective Application Programming Interfaces (APIs) (such as java.lang.reflect in Java SE) allow a test framework module to access a module element within a particular module even if that module element has not been exposed by the particular module to the test framework module. In another example, the .NET platform's reflective API allows for access to the internals of any module.
The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.